package com.fansl.allround.open.api.feign.factory;

import com.fansl.allround.open.api.feign.RemoteEmailService;
import com.fansl.allround.open.api.feign.fallback.RemoteEmailServiceFallbackImpl;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @author fansl
 * @Description: TODO
 * @date 2019/10/10 17:32
 */
@Component
public class RemoteEmailServiceFallbackFactory implements FallbackFactory<RemoteEmailService> {
    @Override
    public RemoteEmailService create(Throwable throwable) {
        RemoteEmailServiceFallbackImpl fallback = new RemoteEmailServiceFallbackImpl();
        fallback.setCause(throwable);
        return fallback;
    }
}
